package com.mapull.list;

import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * ListToMap
 *
 * @author mapull
 * @date 2021-07-11
 * @since 1.0
 **/
public class ListToMap {
//    static List<Book> list = Arrays.asList(
//            new Book(427, "十年踪迹", "写给普通人看的网页开发课", 9.9),
//            new Book(110, "阿面", "Uniapp 从入门到进阶", 29.9),
//            new Book(188, "十年踪迹", "前端工程师进阶 10 日谈", 29.9),
//            new Book(99, "程序员十三", "Vue 商城项目开发实战", 49)
//    );

    public static void main(String[] args) {
//        List<Integer> list = new ArrayList<>();
        List<Integer> l2 = new LinkedList<>();
        l2.add(1);
        List<Integer> list = new CopyOnWriteArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(5);
        for(Integer i : list){
            System.out.println(i);
            if(i == 3){
                list.add(4);
            }
        }
        System.out.println(list);
    }

}
